<template>
  <div class="student">
    <el-container>
      <el-aside width="200px">
        <el-scrollbar>
          <el-menu>
            <el-menu-item-group title="班级">
              <el-menu-item v-for="item in claslist" :key="item">
                <div @click="selectClass(item)">{{ item }}</div>
              </el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group title="训练营">
              <el-menu-item v-for="item in camplist" :key="item">
                <div @click="selectCamp(item)">{{ item }}</div>
              </el-menu-item>
            </el-menu-item-group>
          </el-menu>
        </el-scrollbar>
      </el-aside>
      <el-main>
        <div v-if="a == 1">
          <Classmanger :type="b" />
        </div>
        <div v-else>
          <TrainingCamp :type="b" />
        </div>
      </el-main>
    </el-container>
  </div>
</template>

<script>
import Classmanger from "./SmallPage/Classmanger.vue";
import TrainingCamp from "./SmallPage/TrainingCamp.vue";
export default {
  components: {
    Classmanger,
    TrainingCamp
  },
  data() {
    return {
      claslist: ["软件2201", "软件2202"],
      camplist: ["软件开发训练营", "移动开发训练营"],
      a: 1,
      b: ""
    };
  },
  methods: {
    selectClass(item) {
      this.a = 1;
      this.b = item;
      console.log(this.a);
    },
    selectCamp(item) {
      this.a = 2;
      this.b = item;
      console.log(this.a);
    }
  },
  mounted() {}
};
</script>

<style scoped>
.student {
  display: flex;
  flex-direction: row;
}
</style>